home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Printing / STD File Saver 2.0 / Source / driverTypes.h < prev    next >
Encoding:
Text File  |  1996-01-08  |  5.3 KB  |  186 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Copyright 1991-1996 Apple Computer. All rights reserved.
  3. **
  4. **    You may incorporate this sample code into your applications without
  5. **    restriction, though the sample code has been provided "AS IS" and the
  6. **    responsibility for its operation is 100% yours.  However, what you are
  7. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  8. **    after having made changes. If you're going to re-distribute the source,
  9. **    we require that you make it clear in the source that the code was
  10. **    descended from Apple Sample Code, but that you've made changes.
  11. */
  12.  
  13. //Description of the PrintX array:
  14. //  0        used as Enum            value 0 corresponding to A4 format                 (style Dlg)
  15. //                                   value 1 corresponding to US format                 (style Dlg)
  16. //                                   value 2 corresponding to Custom format             (style Dlg)
  17. //  1        reserved
  18. //  2        used as Integer         Horizontal value for Custom format                 (style Dlg)
  19. //  3        used as Integer         Vertical value for Custom format                   (style Dlg)
  20. //  4        used as Enum            value 0 corresponding to MilliInches unit          (style Dlg)
  21. //                                   value 1 corresponding to MilliMeters unit          (style Dlg)
  22. //                                   value 2 corresponding to Pixel unit                (style Dlg)
  23. //  5        used as Boolean         value 0 corresponding to Portrait Orientation      (style Dlg)
  24. //                                   value 1 corresponding to LandScape Orientation     (style Dlg)
  25. //  6        used as Boolean         value 0 corresponding to All pages                 (job Dlg)
  26. //                                   value 1 corresponding to pages From … To …         (job Dlg)
  27. //  7        used as Integer         signature $5346 "SF"
  28. //  8        used as Boolean         value 0 corresponding to Color                     (job Dlg)
  29. //                                   value 1 corresponding to Black & White             (job Dlg)
  30. //  9        used as Boolean         value 0 corresponding to PicComment saving         (option Dlg)
  31. //                                   value 1 corresponding to PicComment ignoring       (option Dlg)
  32. //  10-18    reserved
  33.  
  34. #define setPrintErr(err) {*((short *)0x944) = err;}
  35.  
  36. // the following two macros tell the Icon Utilities to use CopyBits
  37. // instead of using CopyMask (which doesn't hit the bottleneck)
  38. #ifndef COMPRESSED_DATA
  39. /* If we're supporting compressed data printing, we've got our own
  40. ** StdPix function (see DraftPrPix in MyPDEF_0_DraftMode.c), and
  41. ** we don't need to do this kludge
  42. */
  43. #define setIsPrintingFlag() {*((short *)0x948) = 0;}
  44. #define clearIsPrintingFlag() {*((short *)0x948) = -1;}
  45. #else /* COMPRESSED_DATA */
  46. #define setIsPrintingFlag() {}
  47. #define clearIsPrintingFlag() {}
  48. #endif /* COMPRESSED_DATA */
  49.  
  50. #ifdef isdigit
  51. /* I REALLY want my own isdigit, which won't use any globals */
  52. #undef isdigit
  53. #endif
  54. #define isdigit(c) ((c>='0')&&(c<='9'))
  55.  
  56. #define countof(foo)    (sizeof(foo)/sizeof(foo[0]))
  57.  
  58. enum {
  59.     mySignature = 0x5346    // 'SF'
  60. };
  61.  
  62. enum {        // for TextEdit selections
  63.     startSelectAll = 0,
  64.     endSelectAll = 32767
  65. };
  66.  
  67. enum {
  68.     formFeed = 0x0c,
  69.     carriageReturn = 0x0d
  70. };
  71.  
  72. enum {        // dialog items, both dialogs
  73.     printInvalidItem = -1,
  74.     printOkButton = 1,
  75.     printCancelButton
  76. };
  77.  
  78. enum {        // dialog items, page setup 
  79.     jobTitleItemID = 3,
  80.     jobRangeTitleID,
  81.     jobAllButtonID,
  82.     jobFromButtonID,
  83.     jobFromTextID,
  84.     jobToTitleID,
  85.     jobToTextID,
  86.     jobDivider1,
  87.     jobDivider2,
  88.     jobColorButtonID,
  89.     jobBlackWhiteButtonID
  90. };
  91.  
  92. enum {        // dialog items, page setup dialog
  93.     stlWindowTitleID = 3,
  94.     stlOrientationTitleID,
  95.     stlPaperTitleID,
  96.     stlPaperA4SizeButtonID,
  97.     stlPaperLetterSizeButtonID,
  98.     stlPaperCustomSizeButtonID,
  99.     stlPortraitIconID,
  100.     stlLandscapeIconID,
  101.     stlDivider1ID,
  102.     stlDivider2ID,
  103.     stlHorizTitleID,
  104.     stlVertTitleID,
  105.     stlUnitsTitleID,
  106.     stlHorizTextID,
  107.     stlVertTextID,
  108.     stlMilliInchButtonID,
  109.     stlMilliMeterButtonID,
  110.     stlPixelsButtonID,
  111.     stlHelpButtonID
  112. };
  113.  
  114. enum {        // character constants
  115.     enterKey = 3,
  116.     backspaceKey = 8,
  117.     tabKey = 9,
  118.     returnKey = 0x0d,
  119.     escape = 0x1b,
  120.     period = '.'
  121. };
  122.  
  123. enum {        // resource IDs
  124.     pageSetupDialogID = 0xE001,    // -8191
  125.     printDialogID = 0xE000,
  126.     optionsDialogID = 0xDFFF,    // -8193
  127.     helpDialogID = 0xDFFE,
  128.     badValueAlertID = -8160
  129. };
  130.  
  131. enum {    // 'STR ' IDs
  132.     defaultFileNameID = -8191,
  133.     unknownStrID0 = -4090,
  134.     unknownStrID1 = -4091,
  135.     unknownStrID2 = -4092,
  136.     unknownStrID3 = -4093,
  137.     unknownStrID4 = -4096
  138. };
  139.  
  140. enum {    // paper sizes
  141.     printOnA4,
  142.     printOnLetter,
  143.     printOnLegal,
  144.     printOnCustom,
  145.     printOnUndefined
  146. };
  147.  
  148. enum {    // units to measure custom size in
  149.     unitsMilliInch,
  150.     unitsMilliMeter,
  151.     unitsPixels,
  152.     unitsUndefined
  153. };
  154.  
  155. typedef struct {
  156.     Str255        dirName;
  157.     long        dirID;
  158.     short        dirVol;
  159.     Str255        fileName;
  160.     short        fileRef;
  161.     GrafPtr        OtherPort;
  162.     PicHandle    thePict;
  163.     short        CurPage;
  164.     short        firstPage;
  165.     short        lastPage;
  166.     CQDProcs    cProcs;
  167.     PrIdleUPP    idleProc;
  168. } MyPrintRec, *MyPrintPtr;
  169.  
  170. // we use this next one all over the place. The idea is to copy the GrafPort
  171. // except for picSave, rgnSave, polySave, and grafProcs. We're going to
  172. // replace those with our own values, except for those that we Just Want To
  173. // Be Nil
  174. #define mostOfGrafPort (sizeof(GrafPort)-16)
  175.  
  176. #ifndef VER_SHORT
  177. #define VER_SHORT 0
  178. #endif
  179.  
  180. #ifndef VER_STRING
  181. #define VER_STRING "Debug"
  182. #endif
  183.  
  184. #define IDENT "PictDriver "VER_STRING", Copyright 1996, Apple Computer Inc."
  185.  
  186.